package lobby.service.impl;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

public class Main {

	public static void main(String[] args) {
		Main m = new Main();
		
		
	}
	
	public String readTXT() {
		String encoding = "UTF-8";  
		File file = new File("C:\\Users\\Eric\\Desktop\\direct.txt");  
		Long filelength = file.length();  
		byte[] filecontent = new byte[filelength.intValue()];  
		try {  
			FileInputStream in = new FileInputStream(file);  
			in.read(filecontent);  
			in.close();  
		} catch (FileNotFoundException e) {  
			e.printStackTrace();  
		} catch (IOException e) {  
			e.printStackTrace();  
		}  
		try {  
			return new String(filecontent, encoding);  
		} catch (UnsupportedEncodingException e) {  
			System.err.println("The OS does not support " + encoding);  
			e.printStackTrace();  
			return null;  
		}  
	}
}
